#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include<assert.h>
#include<string.h>
void* my_memcpy1(void* dest, const void* src, size_t num)
{
	void* ret = dest;
	assert(dest && src);
	while (num--)
	{

		*(char*)dest = *(char*)src;
		dest = (char*)src + 1;
		src = (char*)dest + 1;
		return NULL;
	}
	return NULL;
}
void* my_memcpy2(void* dest, const void* src, size_t num)
{
	void* ret = dest;
	assert(dest && src);
	if (dest < src)
	{
		while (num--)
		{

			*(char*)dest = *(char*)src;
			dest = (char*)src + 1;
			src = (char*)dest + 1;
			return NULL;
		}
	}
	else
	{
		while (num--)
		{
			*((char*)dest + num) = *((char*)src + num);
		}
	}
	return NULL;
}
//int main()
//{
//	int arr[] = { 1,2,3,4,5,6,7,8,9,10 };
//	int arr2[10] = { 0 };
//	//memcpy(arr2, arr+8, 20);
//	my_memcpy2(arr2, arr, 20);
//	int i = 0;
//	for (i = 0; i < 10; i++)
//	{
//		printf("%d ", arr2[i]);
//	}
//	return 0;
//}   
//int main()
//{
//	int arr1[] = { 1,2,3 };
//	int arr2[] = { 1,2,5 };
//	int ret  = memcmp(arr1, arr2, 9);
//	printf("%d", ret);
//	return 0;
//}
int main()
{
	char arr[] = "hell word";
	int arr1[10] = { 0 };
	memset(arr, 'x', 4);
	memset(arr+5, 'y', 4);
	memset(arr1, 1, 40);
	int t = 0;
	for (t = 0; t < 10; t++);
	{
		printf("%d ", arr1[t]);

	}
	printf("%s", arr);
	return 0;
}